<h1>View Taxpayer "<?php echo $taxpayer?>"</h1>

<table>
  <tbody>
    <tr>
      <th>ID: </th>
      <td><?php echo $taxpayer["id"]?></td>
    </tr>
    <tr>
      <th>Plate: </th>
      <td><?php echo $taxpayer["name"]?></td>
    </tr>
    <tr>
      <th>Model: </th>
      <td><?php echo $taxpayer["address"]?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Edit","taxpayer/edit?id=".$taxpayer["id"])?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Delete","taxpayer/delete?id=".$taxpayer["id"],array('method'=>'delete','confirm'=>"Delete: Are you sure?"))?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Add Vehicle","vehicle/new?taxpayer_id=".$taxpayer["id"])?></td>
    </tr>
  </tbody>
</table>
<hr>
Vehicles:
<table>
  <thead>
    <tr>
      <th></th>
      <th> | </th>
      <th></th>
      <th> | </th>
      <th>Plate</th>
      <th> | </th>
      <th>Model</th>
      <th> | </th>
      <th>Registration</th>
      <th> | </th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($taxpayer->getVehicles() as $vehicle): ?>
    <tr>
      <td><?php echo link_to("Show","vehicle/show?id=".$vehicle["id"])?></td>
      <td> | </td>
      <td><?php echo link_to("Edit","vehicle/edit?id=".$vehicle["id"])?></td>
      <td> | </td>
      <td><?php echo link_to($vehicle,"vehicle/show?id=".$vehicle["id"])?></td>
      <td> | </td>
      <td><?php echo $vehicle["model"]?></td>
      <td> | </td>
      <td><?php echo $vehicle["registration"]?></td>
      <td> | </td>
      <td><?php echo link_to("Add Receipt","receipt/new?vehicle_id=".$vehicle["id"])?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

